package jnpf.controller;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.entity.VisualdevEntity;
import jnpf.base.service.VisualdevService;
import jnpf.base.util.DynDicUtil;
import jnpf.base.util.VisualUtils;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.engine.enums.FlowStatusEnum;
import jnpf.engine.service.FlowTaskService;
import jnpf.entity.*;
import jnpf.exception.DataException;
import jnpf.exception.WorkFlowException;
import jnpf.generater.util.GeneraterSwapUtil;
import jnpf.model.common.ZXGL_FlowWriteBack;
import jnpf.model.zxgl_renwufankui.*;
import jnpf.model.zxgl_xiangmufankui.ZXGL_AI_xmfk_CallBack;
import jnpf.service.*;
import jnpf.util.JsonUtil;
import jnpf.util.RandomUtil;
import jnpf.util.UserProvider;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * ZXGL_RenWuFanKui
 *
 * @版本： V2.0
 * @版权： 河北交投智能交通技术有限责任公司
 * @作者： 数字交投项目组
 * @日期： 2025-03-21
 */
@Slf4j
@RestController
@Api(tags = "任务反馈", value = "zxgl")
@RequestMapping("/ZXGL_RenWuFanKui")
public class ZXGL_RenWuFanKuiController {


    @Autowired
    private DynDicUtil dynDicUtil;

    @Autowired
    private GeneraterSwapUtil generaterSwapUtil;

    @Autowired
    private UserProvider userProvider;

    @Autowired
    private VisualdevService visualdevService;

    @Autowired
    private FlowTaskService flowTaskService;

    @Autowired
    private ZXGL_RenWuFanKuiService zXGL_RenWuFanKuiService;

    @Autowired
    private ZXGL_RenWuFanKuiJiaoFuWuService zXGL_RenWuFanKuiJiaoFuWuService;

    @Autowired
    private ZXGL_XieBanRenWuFanKuiMXService zXGL_XieBanRenWuFanKuiMXService;

    @Autowired
    private ZXGL_XiangMuFenJie_mingxibiaoService zxglXiangMuFenJieMingxibiaoService;

    @Autowired
    private ZXGL_XiangMuLiXiang_MingXiService zxglXiangMuLiXiangMingXiService;

    /**
     * 列表
     *
     * @param zXGL_RenWuFanKuiPagination
     * @return
     */
    @ApiOperation("任务反馈分页")
    @PostMapping("/getList")
    public ActionResult list(@RequestBody ZXGL_RenWuFanKuiPagination zXGL_RenWuFanKuiPagination) throws IOException {
        List<ZXGL_RenWuFanKuiEntity> list = zXGL_RenWuFanKuiService.getList(zXGL_RenWuFanKuiPagination);
        //处理id字段转名称，若无需转或者为空可删除
        for (ZXGL_RenWuFanKuiEntity entity : list) {
            entity.setFkr(generaterSwapUtil.userSelectValues(entity.getFkr()));
            entity.setFkbm(generaterSwapUtil.comSelectValues(entity.getFkbm()));
            entity.setRwlx(dynDicUtil.getDicName(entity.getRwlx(), "670160918163781253"));
            // entity.setRwlx(dynDicUtil.getDicName(entity.getRwlx(), "667277254828496197"));

            entity.setXbr(generaterSwapUtil.userSelectValues(entity.getXbr()));
            entity.setXbrsffk(dynDicUtil.getDicName(entity.getXbrsffk(), "669876395320571525"));
            entity.setXbrsfyqbfk(dynDicUtil.getDicName(entity.getXbrsfyqbfk(), "669876395320571525"));
        }
        List<ZXGL_RenWuFanKuiListVO> listVO = JsonUtil.getJsonToList(list, ZXGL_RenWuFanKuiListVO.class);
        for (ZXGL_RenWuFanKuiListVO zXGL_RenWuFanKuiVO : listVO) {
        }


        for (ZXGL_RenWuFanKuiListVO vo : listVO) {
            FlowTaskEntity flowTaskEntity = flowTaskService.getInfoSubmit(vo.getId());
            if (flowTaskEntity != null) {
                vo.setFlowState(flowTaskEntity.getStatus());
            } else {
                vo.setFlowState(null);
            }
        }
        PageListVO vo = new PageListVO();
        vo.setList(listVO);
        PaginationVO page = JsonUtil.getJsonToBean(zXGL_RenWuFanKuiPagination, PaginationVO.class);
        vo.setPagination(page);
        return ActionResult.success(vo);
    }


    /**
     * 创建
     *
     * @param zXGL_RenWuFanKuiCrForm
     * @return
     */
    @ApiOperation("添加任务反馈信息")
    @PostMapping
    @Transactional
    public ActionResult create(@RequestBody @Valid ZXGL_RenWuFanKuiCrForm zXGL_RenWuFanKuiCrForm) throws DataException {
        String visualId = "667365275280088261";
        VisualdevEntity visualdevEntity = visualdevService.getInfo(visualId);
        String mainId = RandomUtil.uuId();
        UserInfo userInfo = userProvider.get();

        // region 赋值部门负责人和领导
        ZXGL_XiangMuFenJie_mingxibiaoEntity model = zxglXiangMuFenJieMingxibiaoService.getInfo(zXGL_RenWuFanKuiCrForm.getRwid());
        zXGL_RenWuFanKuiCrForm.setDepartmentManagerZzbm(model.getDepartmentManagerZzbm());
        zXGL_RenWuFanKuiCrForm.setDepartmentHeadleaderZzbm(model.getDepartmentHeadleaderZzbm());
        // endregion

        // region 从项目库读取项目责任人并赋值
        ZXGL_XiangMuLiXiang_MingXiEntity mingXiEntity = zxglXiangMuLiXiangMingXiService.getById(zXGL_RenWuFanKuiCrForm.getXmid());
        if (mingXiEntity != null) {
            zXGL_RenWuFanKuiCrForm.setXmzrr(mingXiEntity.getZzr());
        }
        // endregion

        // region 赋值主责人是否为部门负责人
        if (StrUtil.isNotEmpty(zXGL_RenWuFanKuiCrForm.getDepartmentManagerZzbm()) && zXGL_RenWuFanKuiCrForm.getFkr().equals(zXGL_RenWuFanKuiCrForm.getDepartmentManagerZzbm())) {
            zXGL_RenWuFanKuiCrForm.setZzrsfbmfzr("669876724938339973"); // 是
        } else {
            zXGL_RenWuFanKuiCrForm.setZzrsfbmfzr("669876694466721413"); // 否
        }
        // endregion

        ZXGL_RenWuFanKuiEntity entity = JsonUtil.getJsonToBean(zXGL_RenWuFanKuiCrForm, ZXGL_RenWuFanKuiEntity.class);

        entity.setId(mainId);
        entity.setCreatorTime(new Date());


        zXGL_RenWuFanKuiService.save(entity);

        if (zXGL_RenWuFanKuiCrForm.getZxgl_renwufankuijiaofuwuList() != null && zXGL_RenWuFanKuiCrForm.getZxgl_renwufankuijiaofuwuList().size() > 0) {
            List<ZXGL_RenWuFanKuiJiaoFuWuEntity> ZXGL_RenWuFanKuiJiaoFuWuList = JsonUtil.getJsonToList(zXGL_RenWuFanKuiCrForm.getZxgl_renwufankuijiaofuwuList(), ZXGL_RenWuFanKuiJiaoFuWuEntity.class);
            if (ZXGL_RenWuFanKuiJiaoFuWuList != null && ZXGL_RenWuFanKuiJiaoFuWuList.size() > 0) {
                for (ZXGL_RenWuFanKuiJiaoFuWuEntity entitys : ZXGL_RenWuFanKuiJiaoFuWuList) {
                    entitys.setId(RandomUtil.uuId());
                    entitys.setMainid(entity.getId());
                    zXGL_RenWuFanKuiJiaoFuWuService.save(entitys);
                }
            }
        }

        if (zXGL_RenWuFanKuiCrForm.getZxgl_xiebanrenwufankuimxList() != null && zXGL_RenWuFanKuiCrForm.getZxgl_xiebanrenwufankuimxList().size() > 0) {
            List<ZXGL_XieBanRenWuFanKuiMXEntity> ZXGL_XieBanRenWuFanKuiMXList = JsonUtil.getJsonToList(zXGL_RenWuFanKuiCrForm.getZxgl_xiebanrenwufankuimxList(), ZXGL_XieBanRenWuFanKuiMXEntity.class);

            for (ZXGL_XieBanRenWuFanKuiMXEntity entitys : ZXGL_XieBanRenWuFanKuiMXList) {
                entitys.setId(RandomUtil.uuId());
                entitys.setMainid(entity.getId());
                zXGL_XieBanRenWuFanKuiMXService.save(entitys);
            }
        }

        if (FlowStatusEnum.submit.getMessage().equals(zXGL_RenWuFanKuiCrForm.getStatus())) {
            try {
                VisualUtils.submitFlowTask(visualdevEntity, mainId, zXGL_RenWuFanKuiCrForm, userInfo, zXGL_RenWuFanKuiCrForm.getCandidateList());
                FlowTaskEntity flowTaskEntity = flowTaskService.getInfo(mainId);
                log.info("flowTaskEntity:==================================>" + flowTaskEntity.toString());
                if (flowTaskEntity != null) {
                    flowTaskEntity.setTitle(zXGL_RenWuFanKuiCrForm.getRwmc() + "-任务反馈-" + userInfo.getUserName() + "-" + DateUtil.today());
                    flowTaskEntity.setDataTable("zxgl_renwufankui");
                    flowTaskService.update(flowTaskEntity);
                }
            } catch (WorkFlowException e) {
                e.printStackTrace();
            }
            return ActionResult.success("提交成功，请耐心等待");
        }
        return ActionResult.success("保存成功", mainId);
    }


    /**
     * 信息
     *
     * @param id
     * @return
     */
    @ApiOperation("任务反馈信息")
    @GetMapping("/{id}")
    public ActionResult<ZXGL_RenWuFanKuiInfoVO> info(@PathVariable("id") String id) {
        ZXGL_RenWuFanKuiEntity entity = zXGL_RenWuFanKuiService.getInfo(id);
        ZXGL_RenWuFanKuiInfoVO vo = JsonUtil.getJsonToBean(entity, ZXGL_RenWuFanKuiInfoVO.class);

        //子表
        List<ZXGL_RenWuFanKuiJiaoFuWuModel> model = new ArrayList<>();
        List<ZXGL_RenWuFanKuiJiaoFuWuEntity> ZXGL_RenWuFanKuiJiaoFuWuList = zXGL_RenWuFanKuiService.GetZXGL_RenWuFanKuiJiaoFuWuList(id);
        if (ZXGL_RenWuFanKuiJiaoFuWuList != null && ZXGL_RenWuFanKuiJiaoFuWuList.size() > 0) {
            for (ZXGL_RenWuFanKuiJiaoFuWuEntity zxgl_renwufankuijiaofuwuEntity : ZXGL_RenWuFanKuiJiaoFuWuList) {
                ZXGL_RenWuFanKuiJiaoFuWuModel zxglRenWuFanKuiJiaoFuWuModel = new ZXGL_RenWuFanKuiJiaoFuWuModel();
                zxglRenWuFanKuiJiaoFuWuModel.setJfw(zxgl_renwufankuijiaofuwuEntity.getJfw());
                model.add(zxglRenWuFanKuiJiaoFuWuModel);
            }
            vo.setZXGL_RenWuFanKuiJiaoFuWuList(model);
        }
        vo.setZXGL_RenWuFanKuiJiaoFuWuList(JsonUtil.getJsonToList(ZXGL_RenWuFanKuiJiaoFuWuList, ZXGL_RenWuFanKuiJiaoFuWuModel.class));
        List<ZXGL_XieBanRenWuFanKuiMXEntity> ZXGL_XieBanRenWuFanKuiMXList = zXGL_RenWuFanKuiService.GetZXGL_XieBanRenWuFanKuiMXList(id);
        for (ZXGL_XieBanRenWuFanKuiMXEntity zxgl_xiebanrenwufankuimxEntity : ZXGL_XieBanRenWuFanKuiMXList) {

        }
        vo.setZXGL_XieBanRenWuFanKuiMXList(JsonUtil.getJsonToList(ZXGL_XieBanRenWuFanKuiMXList, ZXGL_XieBanRenWuFanKuiMXModel.class));
        //副表
        return ActionResult.success(vo);
    }


    /**
     * 更新
     *
     * @param id
     * @return
     */
    @ApiOperation("修改任务反馈信息")
    @PutMapping("/{id}")
    @Transactional
    public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ZXGL_RenWuFanKuiUpForm zXGL_RenWuFanKuiUpForm) throws DataException {
        String visualId = "667365275280088261";
        VisualdevEntity visualdevEntity = visualdevService.getInfo(visualId);
        UserInfo userInfo = userProvider.get();
        ZXGL_RenWuFanKuiEntity entity = zXGL_RenWuFanKuiService.getInfo(id);
        if (entity != null) {

            // region 赋值部门负责人和领导
            ZXGL_XiangMuFenJie_mingxibiaoEntity model = zxglXiangMuFenJieMingxibiaoService.getInfo(zXGL_RenWuFanKuiUpForm.getRwid());
            zXGL_RenWuFanKuiUpForm.setDepartmentManagerZzbm(model.getDepartmentManagerZzbm());
            zXGL_RenWuFanKuiUpForm.setDepartmentHeadleaderZzbm(model.getDepartmentHeadleaderZzbm());
            // endregion

            // region 从项目库读取项目责任人并赋值
            ZXGL_XiangMuLiXiang_MingXiEntity mingXiEntity = zxglXiangMuLiXiangMingXiService.getById(zXGL_RenWuFanKuiUpForm.getXmid());
            if (mingXiEntity != null) {
                zXGL_RenWuFanKuiUpForm.setXmzrr(mingXiEntity.getZzr());
            }
            // endregion

            // region 赋值主责人是否为部门负责人
            if (StrUtil.isNotEmpty(zXGL_RenWuFanKuiUpForm.getDepartmentManagerZzbm()) && zXGL_RenWuFanKuiUpForm.getXmzrr().equals(zXGL_RenWuFanKuiUpForm.getDepartmentManagerZzbm())) {
                zXGL_RenWuFanKuiUpForm.setZzrsfbmfzr("669876724938339973"); // 是
            } else {
                zXGL_RenWuFanKuiUpForm.setZzrsfbmfzr("669876694466721413"); // 否
            }
            // endregion

            ZXGL_RenWuFanKuiEntity subentity = JsonUtil.getJsonToBean(zXGL_RenWuFanKuiUpForm, ZXGL_RenWuFanKuiEntity.class);


            zXGL_RenWuFanKuiService.update(id, subentity);

            QueryWrapper<ZXGL_RenWuFanKuiJiaoFuWuEntity> ZXGL_RenWuFanKuiJiaoFuWuqueryWrapper = new QueryWrapper<>();
            ZXGL_RenWuFanKuiJiaoFuWuqueryWrapper.lambda().eq(ZXGL_RenWuFanKuiJiaoFuWuEntity::getMainid, entity.getId());
            zXGL_RenWuFanKuiJiaoFuWuService.remove(ZXGL_RenWuFanKuiJiaoFuWuqueryWrapper);

            if (zXGL_RenWuFanKuiUpForm.getZxgl_renwufankuijiaofuwuList() != null && zXGL_RenWuFanKuiUpForm.getZxgl_renwufankuijiaofuwuList().size() > 0) {
                List<ZXGL_RenWuFanKuiJiaoFuWuEntity> ZXGL_RenWuFanKuiJiaoFuWuList = JsonUtil.getJsonToList(zXGL_RenWuFanKuiUpForm.getZxgl_renwufankuijiaofuwuList(), ZXGL_RenWuFanKuiJiaoFuWuEntity.class);
                for (ZXGL_RenWuFanKuiJiaoFuWuEntity entitys : ZXGL_RenWuFanKuiJiaoFuWuList) {
                    entitys.setId(RandomUtil.uuId());
                    entitys.setMainid(entity.getId());
                    zXGL_RenWuFanKuiJiaoFuWuService.save(entitys);
                }
            }


            QueryWrapper<ZXGL_XieBanRenWuFanKuiMXEntity> ZXGL_XieBanRenWuFanKuiMXqueryWrapper = new QueryWrapper<>();
            ZXGL_XieBanRenWuFanKuiMXqueryWrapper.lambda().eq(ZXGL_XieBanRenWuFanKuiMXEntity::getMainid, entity.getId());
            zXGL_XieBanRenWuFanKuiMXService.remove(ZXGL_XieBanRenWuFanKuiMXqueryWrapper);

            if (zXGL_RenWuFanKuiUpForm.getZxgl_xiebanrenwufankuimxList() != null && zXGL_RenWuFanKuiUpForm.getZxgl_xiebanrenwufankuimxList().size() > 0) {
                List<ZXGL_XieBanRenWuFanKuiMXEntity> ZXGL_XieBanRenWuFanKuiMXList = JsonUtil.getJsonToList(zXGL_RenWuFanKuiUpForm.getZxgl_xiebanrenwufankuimxList(), ZXGL_XieBanRenWuFanKuiMXEntity.class);
                for (ZXGL_XieBanRenWuFanKuiMXEntity entitys : ZXGL_XieBanRenWuFanKuiMXList) {
                    entitys.setId(RandomUtil.uuId());
                    entitys.setMainid(entity.getId());
                    zXGL_XieBanRenWuFanKuiMXService.save(entitys);
                }
            }


            if (FlowStatusEnum.submit.getMessage().equals(zXGL_RenWuFanKuiUpForm.getStatus())) {
                try {
                    VisualUtils.submitFlowTask(visualdevEntity, id, subentity, userInfo, zXGL_RenWuFanKuiUpForm.getCandidateList());
                    FlowTaskEntity flowTaskEntity = flowTaskService.getInfo(id);
                    log.info("flowTaskEntity:==================================>" + flowTaskEntity);
                    if (flowTaskEntity != null) {
                        flowTaskEntity.setTitle(zXGL_RenWuFanKuiUpForm.getRwmc() + "-任务反馈-" + userInfo.getUserName() + "-" + DateUtil.today());
                        flowTaskEntity.setDataTable("zxgl_renwufankui");
                        flowTaskService.update(flowTaskEntity);
                    }
                } catch (WorkFlowException e) {
                    e.printStackTrace();
                }
                return ActionResult.success("提交成功，请耐心等待");
            }
            return ActionResult.success("更新成功");
        } else {
            return ActionResult.fail("更新失败，数据不存在");
        }
    }

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @ApiOperation("删除任务反馈信息")
    @DeleteMapping("/{id}")
    @Transactional
    public ActionResult delete(@PathVariable("id") String id) {
        ZXGL_RenWuFanKuiEntity entity = zXGL_RenWuFanKuiService.getInfo(id);
        if (entity != null) {
            FlowTaskEntity taskEntity = flowTaskService.getInfoSubmit(id);
            if (taskEntity != null) {
                try {
                    flowTaskService.delete(taskEntity);
                } catch (WorkFlowException e) {
                    e.printStackTrace();
                }
            }
            zXGL_RenWuFanKuiService.delete(entity);
            QueryWrapper<ZXGL_RenWuFanKuiJiaoFuWuEntity> queryWrapperZXGL_RenWuFanKuiJiaoFuWu = new QueryWrapper<>();
            queryWrapperZXGL_RenWuFanKuiJiaoFuWu.lambda().eq(ZXGL_RenWuFanKuiJiaoFuWuEntity::getMainid, entity.getId());
            zXGL_RenWuFanKuiJiaoFuWuService.remove(queryWrapperZXGL_RenWuFanKuiJiaoFuWu);
            QueryWrapper<ZXGL_XieBanRenWuFanKuiMXEntity> queryWrapperZXGL_XieBanRenWuFanKuiMX = new QueryWrapper<>();
            queryWrapperZXGL_XieBanRenWuFanKuiMX.lambda().eq(ZXGL_XieBanRenWuFanKuiMXEntity::getMainid, entity.getId());
            zXGL_XieBanRenWuFanKuiMXService.remove(queryWrapperZXGL_XieBanRenWuFanKuiMX);

        }
        return ActionResult.success("删除成功");
    }

    /***
     * 任务反馈协办人修改协同人子表信息
     * @param flowWriteBack
     * @return
     */
    @ApiOperation("任务反馈协办人修改协同人子表信息")
    @PostMapping("/updateXieBanMX")
    @Transactional
    public Boolean updateXieBanMX(@RequestBody ZXGL_FlowWriteBack flowWriteBack) {
        return zXGL_XieBanRenWuFanKuiMXService.updateXieBanMX(flowWriteBack.getTaskId());
    }

    /***
     * 更新任务反馈主表状态
     * @param flowWriteBack
     * @return
     */
    @ApiOperation("更新任务反馈主表状态")
    @PostMapping("/updatespzt")
    @Transactional
    public Boolean updatespzt(@RequestBody ZXGL_FlowWriteBack flowWriteBack) {
        log.info("任务反馈更新任务库信息===================================》");
        log.info("zxglRenWuFanKuiInfoVO" + flowWriteBack.getTaskId());
        return zXGL_RenWuFanKuiService.updatespzt(flowWriteBack.getTaskId());
    }


    @ApiOperation("根据项目Id生成任务反馈信息")
    @GetMapping("/getRenWu/{xmId}")
    public ActionResult getRenWu(@PathVariable("xmId") String xmId) {
        return ActionResult.success(zXGL_RenWuFanKuiService.getRenWu(xmId));
    }

    /***
     * 任务反馈AI回调接口
     * @param zxglAiXmfkCallBack
     * @return
     * @throws DataException
     */
    @ApiOperation("任务反馈AI回调接口")
    @PostMapping("/allocateRenWuFankuiCallBack")
    @Transactional
    public ActionResult allocateRenWuFankuiCallBack(@RequestBody ZXGL_AI_xmfk_CallBack zxglAiXmfkCallBack) throws DataException {
        log.info("allocateResponsibilityCallback----------------------------》回调已经成功");
//        ZXGL_XMCFZGBMJS_MingXiEntity entity = zXGL_XMCFZGBMJS_MingXiService.getById(zxglAiResponsibilityCallBack.getFlowId());
//        if (entity != null) {
//            entity.setQtry(zxglAiResponsibilityCallBack.getReturnJson().getLeadPersonnel().getId());
//            entity.setZrr(zxglAiResponsibilityCallBack.getReturnJson().getProjectManagers().getId());
//            entity.setXzr(zxglAiResponsibilityCallBack.getReturnJson().getCollaborators().getId());
//            zXGL_XMCFZGBMJS_MingXiService.updateById(entity);
//            return ActionResult.success("更新成功");
//        }
        return ActionResult.fail("更新失败，数据不存在");
    }

    /***
     * 更新sftj状态
     * @param flowWriteBack
     * @return
     */
    @ApiOperation("更新sftj状态为是")
    @PostMapping("/updateSftjByIdOne")
    @Transactional
    public Boolean updateSftjByIdOne(@RequestBody ZXGL_FlowWriteBack flowWriteBack) {
        ZXGL_RenWuFanKuiEntity zxglRenWuFanKuiEntity = new ZXGL_RenWuFanKuiEntity();
        zxglRenWuFanKuiEntity.setId(flowWriteBack.getTaskId());
        zxglRenWuFanKuiEntity.setSftj(1);
        return zXGL_RenWuFanKuiService.updateById(zxglRenWuFanKuiEntity);
    }

    /***
     * 更新sftj状态
     * @param flowWriteBack
     * @return
     */
    @ApiOperation("更新sftj状态为否")
    @PostMapping("/updateSftjById")
    @Transactional
    public Boolean updateSftjById(@RequestBody ZXGL_FlowWriteBack flowWriteBack) {
        ZXGL_RenWuFanKuiEntity zxglRenWuFanKuiEntity = new ZXGL_RenWuFanKuiEntity();
        zxglRenWuFanKuiEntity.setId(flowWriteBack.getTaskId());
        zxglRenWuFanKuiEntity.setSftj(0);
        return zXGL_RenWuFanKuiService.updateById(zxglRenWuFanKuiEntity);
    }


}
